<?php
namespace app\admin\controller;

use app\BaseController;
use app\admin\middleware\Check;
use think\Request;


class Admin extends BaseController
{

    // 下述模式是等效的
    protected $middleware = [Check::class];
    // protected $middleware = [\app\admin\middleware\Check::class];

    public function admin($id)
    {
        return 'hello, mike' . $id;
    }

    public function test(Request $request)
    {
        // 使用了路由中间件
        dump($request->username);
    }

}
